package com.healthcarex.hip.saas.common.util;

import org.apache.cxf.endpoint.Client;
import org.apache.cxf.jaxws.endpoint.dynamic.JaxWsDynamicClientFactory;


/**
 * @ClassName: WebserviceUtils
 * @Description:
 * @date 2017/7/4 10:53
 */
public class WebserviceUtils {

    public static Object callWebService(String url, String methodName, Object... obj) {
        try {
            JaxWsDynamicClientFactory dcf = JaxWsDynamicClientFactory.newInstance();
            Client client = dcf.createClient(url);

            Object[] objects = client.invoke(methodName, obj);

            return objects;
        } catch (Exception e) {
            e.printStackTrace();
        }

        return null;
    }



}
